package cn.caplike.demo.shiro.eventbus;

import org.apache.shiro.event.EventBus;
import org.apache.shiro.event.support.DefaultEventBus;

/**
 * Description: 入口.
 *
 * @author LiKe
 * @version 1.0.0
 * @date 2021-06-04 14:14
 */
public class App {

    public static void main(String[] args) {
        // ~ 获取事件总线
        final EventBus eventBus = new DefaultEventBus();

        // ~ (某种意义上的) 事件协调器, 用于发布事件
        final MeetupCoordinator meetupCoordinator = new MeetupCoordinator();
        meetupCoordinator.setEventBus(eventBus);

        final BurgerParticipant burgerHunter = new BurgerParticipant();
        eventBus.register(burgerHunter);

        final PizzaParticipant pizzaHunter = new PizzaParticipant();
        eventBus.register(pizzaHunter);

        meetupCoordinator.putFoodOnTable("啊啊啊!");
    }

}
